﻿var StringComparison =
{
	MatchCase: 0,
	IgnoreCase: 1
};
String.Equals = function Equals(str1, str2, mode)
{
	if (str1 === null || str1 === undefined)
		return str2 === null || str2 === undefined;
	if (str2 === null || str2 === undefined)
		return str1 === null || str1 === undefined;
	switch (mode)
	{
		case StringComparison.MatchCase:
			return str1 == str2;
		case StringComparison.IgnoreCase:
			return str1.toLower() == str2.toLower();
	}
	Throw("Unsupported StringComparison mode of " + mode);
}
